<?php
include 'header.html';
include 'SqlHelper.php';
include 'desplegar.php';
$sqlhelper = new SqlHelper();
$set = $sqlhelper->generarNuevoExpediente();
$fila = mysql_fetch_array($set);
$numeroExpediente = $fila['MAX(Expediente)']+1;
?>
<link href="text.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="validarEntrada.js"> </script>
	<p align="center" class="text">Menu</p>
	</div>
	<br>
		<?php
			$results = $sqlhelper->buscarEntradaConExpedientePorFecha($_POST["f1"],$_POST["f2"]);
			echo "<table border='1'>";
			echo "<tr> <th>Nombre Completo</th><th>Fecha llegada</th><th>Fecha Salida</th>
	  <th>Edad</th> </tr>";
	  // keeps getting the next row until there are no more to get
	  while($row = mysql_fetch_array( $results )) {
		// Print out the contents of each row into a table
		echo "<tr><td>"; 
		echo $row['NombreCompleto'];
		echo "</td><td>";
		echo $row['FechaLlegada'];
		echo "</td><td>";
		echo $row['FechaSalida'];
		echo "</td><td>";
		echo $row['Edad'];
		echo "</td></tr>"; 
	  } 
	  echo "</table>";
	 
	 
	 echo "<br/>";
	 echo "<br/>";
		?>
<?php
include 'footer.html';
?>
